package org.budo.oracle.jdbc.driver;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

import org.budo.jdbc.driver.AbstractBudoJdbcDriver;
import org.budo.jdbc.driver.JdbcUrl;

import oracle.jdbc.OracleDriver;

/**
 * @author lmw
 */
public class BudoOracleJdbcDriver extends AbstractBudoJdbcDriver {
    public static final String[] URL_PREFIX = { "jdbc:oracle" };

    @Override
    public boolean acceptsURL(String url) throws SQLException {
        return JdbcUrl.acceptsURL(url, URL_PREFIX);
    }

    @Override
    public Connection connect(String url, Properties info) throws SQLException {
        Connection connection = new OracleDriver().connect(url, info);
        return new BudoOracleJdbcConnection(connection);
    }
}